package cn.zxy.mapper;

import cn.zxy.model.Classes;
import cn.zxy.model.Person;
import cn.zxy.model.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface ClassesMapper {

    @Select("select * from classes")
    @Results({
            @Result(column = "id",property = "id"),
            @Result(column = "name",property = "name"),
            @Result(
                    column = "id",
                    property = "stu",
                    javaType = List.class,
                    //关注的不是实际返回值类型，而是定义的返回值类型

                    many = @Many(select = "cn.zxy.mapper.StudentMapper.findByCid")

            )
    })


    public List<Classes> findAll();






}
